package com.richie696.connect;

import com.richie696.catalina.connector.Connector;

import java.net.Socket;

public class RequestProcessor extends Thread {

    private final Socket socket;
    private final Connector connector;

    public RequestProcessor(Socket socket, Connector connector) {
        this.socket = socket;
        this.connector = connector;
    }


    @Override
    public void run() {
        ProtocolHandler protocolHandler = connector.getProtocolHandler();
        try {
            protocolHandler.start(connector, socket);
            socket.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
